<?php
class LangClass extends CI_Controller {
	function set_lang() {
		$my_lang = $this->uri->segment ( 1 );
		$this->load->helper ( 'language' );
		$this->load->helper('cookie');
		
		if (! in_array ( $my_lang, get_all_languages () )) {
			$my_lang = get_local ();
			$this->config->set_item ( 'language', get_language_full ( get_local () ) );
		}
		set_cookie ( 'set_language',  $my_lang , $this->config->item ( 'sess_expiration' ) );
		$this->config->set_item ( 'language', get_language_full ( $my_lang ) );
	}
}

/* End of file Langclass.php */
/* Location: Langclass.php */